﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>登陆页</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link href="~/Content/layui/css/layui.css" rel="stylesheet" />
    <link href="~/Content/css/global2.css" rel="stylesheet" />
    <script src="~/Content/js/hm.js"></script>
  
</head>
<body>
    <!-- 头部 -->
    <div class="fly-header layui-bg-blue">
        <div class="layui-container">
            <a class="fly-logo" href="/Home/Index">
                <img src="~/Content/layui/images/logo.png" alt="layui">
            </a>
            <ul class="layui-nav fly-nav layui-hide-xs">
                <li class="layui-nav-item">
                    <a href="/Home/MapPage"><i class="iconfont icon-jifen"></i>地图</a>
                </li>
                <li class="layui-nav-item">
                    <a href="/Admin/AdminLogin/AdminLogin"><i class="iconfont icon-iconmingxinganli"></i>后台</a>
                </li>
                <span class="layui-nav-bar"></span>
            </ul>
            @if (ViewData["UserData"] != null)
            {
                <ul class="layui-nav fly-nav-user">
                    <!-- 登入后的状态 -->
                    <li class="layui-nav-item">
                        <a class="fly-nav-avatar" href="javascript:;">
                            <cite class="layui-hide-xs">@(ViewData["UserData"]).UserName</cite>
                            <img src="~/Content/layui/images/8.jpg">
                            <span class="layui-nav-more"></span>
                        </a>
                        <dl class="layui-nav-child layui-anim layui-anim-upbit">
                            <dd><a href="/user/index"><i class="layui-icon"></i>用户中心</a></dd>
                            <dd><a href="/user/set"><i class="layui-icon"></i>基本设置</a></dd>
                            <dd><a href="/user/comment"><i class="iconfont icon-tongzhi" style="top: 4px;"></i>我的评论</a></dd>
                            <hr style="margin: 5px 0;">
                            <dd><a href="/passport/logout" style="text-align: center;">退出</a></dd>
                        </dl>
                    </li>
                    <span class="layui-nav-bar" style="left: 58px; top: 55px; width: 0px; opacity: 0;"></span>
                </ul>
            }
            else
            {
                <ul class="layui-nav fly-nav-user">
                    <!-- 未登入的状态 -->
                    <li class="layui-nav-item">
                        <a class="iconfont icon-touxiang layui-hide-xs" href="/UserInfo/LoginPage"></a>
                    </li>
                    <li class="layui-nav-item">
                        <a href="/UserInfo/LoginPage">登入</a>
                    </li>
                    <li class="layui-nav-item">
                        <a href="/UserInfo/RegistrationPage">注册</a>
                    </li>
                    <span class="layui-nav-bar"></span>
                </ul>
            }
        </div>
    </div><!-- 头部 end -->
    <div class="layui-container fly-marginTop">
        <div class="fly-panel fly-panel-user" pad20="">
            <div class="layui-tab layui-tab-brief" lay-filter="user">
                <ul class="layui-tab-title">
                    <li class="layui-this">登入</li>
                    <li><a href="/UserInfo/RegistrationPage">注册</a></li>
                </ul>
                <div class="layui-form layui-tab-content" id="LAY_ucm" style="padding: 20px 0;">
                    <div class="layui-tab-item layui-show">
                        <div class="layui-form layui-form-pane">
                            <form method="post" action="/UserInfo/LoginPage">
                                <div class="layui-form-item">
                                    <label for="L_email" class="layui-form-label">帐号</label>
                                    <div class="layui-input-inline">
                                        <input type="text" id="UserAccount" name="UserAccount" required="" lay-verify="required" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label for="L_pass" class="layui-form-label">密码</label>
                                    <div class="layui-input-inline">
                                        <input type="password" id="UserPassWd" name="UserPassWd" required="" lay-verify="required" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <button class="layui-btn" type="button" lay-filter="*" lay-submit>立即登录</button>
                                   
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- 低部 -->
    <div class="fly-footer">
        <p>
        </p>
    </div>
    <script src="~/Content/layui/layui.js"></script>
    <script>
        //上传接口
        layui.use(['jquery', 'form'], function () {
            var $ = layui.jquery, form = layui.form;
            //提交事件触发
            form.on('submit(*)', function (data) {
                //登陆
                $.ajax({
                    type: "post",
                    url: "/UserInfo/Login",
                    data: data.field,
                    dataType: "json",
                    success: function (res) {
                        if (res.code == 0) {
                            layer.msg(res.msg, { icon: 1 });
                            window.location.href = '/Home/Index';
                        }
                        else {
                            layer.msg(res.msg, { icon: 2 });
                        }
                    }
                });
                return false;
            });
        });
    </script>
    <!-- 低部 end -->
    <ul class="layui-fixbar"><li class="layui-icon" lay-type="bar1" style="background-color:#009688"></li><li class="layui-icon layui-fixbar-top" lay-type="top" style="background-color:#009688"></li></ul>
</body>
</html>
